package src.week7.SHIYAN4.Complex;

import java.util.Scanner;
public class ComplexCalculatorTest {
    public static void main(String[] args) {
        double a,b,c,d;
        char option;
        String s2 = null;
        for(;;){
            Scanner scan = new Scanner(System.in);
            System.out.println("Please input the first Realpart:");
            a = scan.nextDouble();
            System.out.println("Please input the first Imagepart:");
            b = scan.nextDouble();
            System.out.println("Please input the second Realpart:");
            c = scan.nextDouble();
            System.out.println("Please input the second Imagepart:");
            d = scan.nextDouble();
            System.out.println("Please choose a calculation kind: (+ - * / >)");
            String s = scan.next();
            option = s.charAt(0);
            ComplexCalculator C = new ComplexCalculator(a,b,c,d);
            switch (option){
                case '+':s2 = C.ComplexAdd();break;
                case '-':s2 = C.ComplexSub();break;
                case '*':s2 = C.ComplexMulti();break;
                case '/':s2 = C.ComplexDiv();break;
                case '>':s2 = C.ComplexCompare();break;
                default:break;
            }
            System.out.println(s2);
            System.out.println("Do you want to continue?(Y/N)");
            String s1 = scan.next();
            char c1 = s1.charAt(0);
            if(c1=='Y'||c1=='y')
                continue;
            else
                break;
        }
    }
}